/*
 * Copyright 2022 NXP
 * SPDX-License-Identifier: MIT
 */

#include "lvgl/lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "custom.h"


void setup_scr_screen(lv_ui *ui){

	//Write codes screen
	ui->screen = lv_obj_create(NULL, NULL);

	//Write codes screen_cont_1
	ui->screen_cont_1 = lv_cont_create(ui->screen, NULL);

	//Write style LV_CONT_PART_MAIN for screen_cont_1
	static lv_style_t style_screen_cont_1_main;
	lv_style_reset(&style_screen_cont_1_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_cont_1_main
	lv_style_set_radius(&style_screen_cont_1_main, LV_STATE_DEFAULT, 0);
	lv_style_set_bg_color(&style_screen_cont_1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_cont_1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_cont_1_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_cont_1_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_cont_1_main, LV_STATE_DEFAULT, lv_color_make(0x99, 0x99, 0x99));
	lv_style_set_border_width(&style_screen_cont_1_main, LV_STATE_DEFAULT, 1);
	lv_style_set_border_opa(&style_screen_cont_1_main, LV_STATE_DEFAULT, 255);
	lv_style_set_pad_left(&style_screen_cont_1_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_right(&style_screen_cont_1_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_top(&style_screen_cont_1_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_bottom(&style_screen_cont_1_main, LV_STATE_DEFAULT, 0);
	lv_obj_add_style(ui->screen_cont_1, LV_CONT_PART_MAIN, &style_screen_cont_1_main);
	lv_obj_set_pos(ui->screen_cont_1, 0, 0);
	lv_obj_set_size(ui->screen_cont_1, 240, 20);
	lv_obj_set_click(ui->screen_cont_1, false);

	//Write codes screen_name
	ui->screen_name = lv_label_create(ui->screen_cont_1, NULL);
	lv_label_set_text(ui->screen_name, "Z_Tool");
	lv_label_set_long_mode(ui->screen_name, LV_LABEL_LONG_BREAK);
	lv_label_set_align(ui->screen_name, LV_LABEL_ALIGN_CENTER);

	//Write style LV_LABEL_PART_MAIN for screen_name
	static lv_style_t style_screen_name_main;
	lv_style_reset(&style_screen_name_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_name_main
	lv_style_set_radius(&style_screen_name_main, LV_STATE_DEFAULT, 0);
	lv_style_set_bg_color(&style_screen_name_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_name_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_name_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_name_main, LV_STATE_DEFAULT, 255);
	lv_style_set_text_color(&style_screen_name_main, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_style_set_text_font(&style_screen_name_main, LV_STATE_DEFAULT, &lv_font_simsun_15);
	lv_style_set_text_letter_space(&style_screen_name_main, LV_STATE_DEFAULT, 2);
	lv_style_set_pad_left(&style_screen_name_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_right(&style_screen_name_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_top(&style_screen_name_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_bottom(&style_screen_name_main, LV_STATE_DEFAULT, 0);
	lv_obj_add_style(ui->screen_name, LV_LABEL_PART_MAIN, &style_screen_name_main);
	lv_obj_set_pos(ui->screen_name, 0, 2);
	lv_obj_set_size(ui->screen_name, 64, 0);

	//Write codes screen_time
	ui->screen_time = lv_label_create(ui->screen_cont_1, NULL);
	lv_label_set_text(ui->screen_time, "20:00");
	lv_label_set_long_mode(ui->screen_time, LV_LABEL_LONG_BREAK);
	lv_label_set_align(ui->screen_time, LV_LABEL_ALIGN_CENTER);

	//Write style LV_LABEL_PART_MAIN for screen_time
	static lv_style_t style_screen_time_main;
	lv_style_reset(&style_screen_time_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_time_main
	lv_style_set_radius(&style_screen_time_main, LV_STATE_DEFAULT, 0);
	lv_style_set_bg_color(&style_screen_time_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_time_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_time_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_time_main, LV_STATE_DEFAULT, 255);
	lv_style_set_text_color(&style_screen_time_main, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_style_set_text_font(&style_screen_time_main, LV_STATE_DEFAULT, &lv_font_simsun_15);
	lv_style_set_text_letter_space(&style_screen_time_main, LV_STATE_DEFAULT, 2);
	lv_style_set_pad_left(&style_screen_time_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_right(&style_screen_time_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_top(&style_screen_time_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_bottom(&style_screen_time_main, LV_STATE_DEFAULT, 0);
	lv_obj_add_style(ui->screen_time, LV_LABEL_PART_MAIN, &style_screen_time_main);
	lv_obj_set_pos(ui->screen_time, 91, 1);
	lv_obj_set_size(ui->screen_time, 58, 0);

	//Write codes screen_battery
	ui->screen_battery = lv_bar_create(ui->screen_cont_1, NULL);

	//Write style LV_BAR_PART_BG for screen_battery
	static lv_style_t style_screen_battery_bg;
	lv_style_reset(&style_screen_battery_bg);

	//Write style state: LV_STATE_DEFAULT for style_screen_battery_bg
	lv_style_set_radius(&style_screen_battery_bg, LV_STATE_DEFAULT, 10);
	lv_style_set_bg_color(&style_screen_battery_bg, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_bg_grad_color(&style_screen_battery_bg, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_bg_grad_dir(&style_screen_battery_bg, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_battery_bg, LV_STATE_DEFAULT, 255);
	lv_style_set_pad_left(&style_screen_battery_bg, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_right(&style_screen_battery_bg, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_top(&style_screen_battery_bg, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_bottom(&style_screen_battery_bg, LV_STATE_DEFAULT, 0);
	lv_obj_add_style(ui->screen_battery, LV_BAR_PART_BG, &style_screen_battery_bg);

	//Write style LV_BAR_PART_INDIC for screen_battery
	static lv_style_t style_screen_battery_indic;
	lv_style_reset(&style_screen_battery_indic);

	//Write style state: LV_STATE_DEFAULT for style_screen_battery_indic
	lv_style_set_radius(&style_screen_battery_indic, LV_STATE_DEFAULT, 10);
	lv_style_set_bg_color(&style_screen_battery_indic, LV_STATE_DEFAULT, lv_color_make(0x00, 0x96, 0xe1));
	lv_style_set_bg_grad_color(&style_screen_battery_indic, LV_STATE_DEFAULT, lv_color_make(0x00, 0xff, 0x00));
	lv_style_set_bg_grad_dir(&style_screen_battery_indic, LV_STATE_DEFAULT, LV_GRAD_DIR_HOR);
	lv_style_set_bg_opa(&style_screen_battery_indic, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_battery, LV_BAR_PART_INDIC, &style_screen_battery_indic);
	lv_obj_set_pos(ui->screen_battery, 189, 2);
	lv_obj_set_size(ui->screen_battery, 46, 15);
	lv_bar_set_anim_time(ui->screen_battery,1000);
	lv_bar_set_value(ui->screen_battery,100,LV_ANIM_OFF);
	lv_bar_set_range(ui->screen_battery,0,100);
	lv_cont_set_layout(ui->screen_cont_1, LV_LAYOUT_OFF);
	lv_cont_set_fit(ui->screen_cont_1, LV_FIT_NONE);

	//Write codes screen_tileview_1
	ui->screen_tileview_1 = lv_tileview_create(ui->screen, NULL);
	static lv_point_t screen_tileview_1_valid_pos[] = {{0, 0},{1, 0},};
	lv_tileview_set_valid_positions(ui->screen_tileview_1, screen_tileview_1_valid_pos, 2);
	lv_tileview_set_edge_flash(ui->screen_tileview_1, true);
	lv_tileview_set_anim_time(ui->screen_tileview_1, 300);

	//Write style LV_TILEVIEW_PART_BG for screen_tileview_1
	static lv_style_t style_screen_tileview_1_bg;
	lv_style_reset(&style_screen_tileview_1_bg);

	//Write style state: LV_STATE_DEFAULT for style_screen_tileview_1_bg
	lv_style_set_radius(&style_screen_tileview_1_bg, LV_STATE_DEFAULT, 0);
	lv_style_set_bg_color(&style_screen_tileview_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_tileview_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_tileview_1_bg, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_tileview_1_bg, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_tileview_1, LV_TILEVIEW_PART_BG, &style_screen_tileview_1_bg);

	//Write style LV_TILEVIEW_PART_EDGE_FLASH for screen_tileview_1
	static lv_style_t style_screen_tileview_1_edge_flash;
	lv_style_reset(&style_screen_tileview_1_edge_flash);

	//Write style state: LV_STATE_DEFAULT for style_screen_tileview_1_edge_flash
	lv_style_set_radius(&style_screen_tileview_1_edge_flash, LV_STATE_DEFAULT, 0);
	lv_style_set_bg_color(&style_screen_tileview_1_edge_flash, LV_STATE_DEFAULT, lv_color_make(0xea, 0xef, 0xf3));
	lv_style_set_bg_grad_color(&style_screen_tileview_1_edge_flash, LV_STATE_DEFAULT, lv_color_make(0xea, 0xef, 0xf3));
	lv_style_set_bg_grad_dir(&style_screen_tileview_1_edge_flash, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_tileview_1_edge_flash, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_tileview_1, LV_TILEVIEW_PART_EDGE_FLASH, &style_screen_tileview_1_edge_flash);

	//Write style LV_TILEVIEW_PART_SCROLLBAR for screen_tileview_1
	static lv_style_t style_screen_tileview_1_scrollbar;
	lv_style_reset(&style_screen_tileview_1_scrollbar);

	//Write style state: LV_STATE_DEFAULT for style_screen_tileview_1_scrollbar
	lv_style_set_radius(&style_screen_tileview_1_scrollbar, LV_STATE_DEFAULT, 0);
	lv_style_set_bg_color(&style_screen_tileview_1_scrollbar, LV_STATE_DEFAULT, lv_color_make(0xea, 0xef, 0xf3));
	lv_style_set_bg_grad_color(&style_screen_tileview_1_scrollbar, LV_STATE_DEFAULT, lv_color_make(0xea, 0xef, 0xf3));
	lv_style_set_bg_grad_dir(&style_screen_tileview_1_scrollbar, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_tileview_1_scrollbar, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_tileview_1, LV_TILEVIEW_PART_SCROLLBAR, &style_screen_tileview_1_scrollbar);
	lv_obj_set_pos(ui->screen_tileview_1, 0, 20);
	lv_obj_set_size(ui->screen_tileview_1, 240, 232);

	//Write codes screen_tileview_1_view1
	ui->screen_tileview_1_view1 = lv_obj_create(ui->screen_tileview_1, NULL);
	lv_obj_set_style_local_bg_opa(ui->screen_tileview_1_view1, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 0);
	lv_obj_set_style_local_border_width(ui->screen_tileview_1_view1, LV_OBJ_PART_MAIN, LV_STATE_FOCUSED, 0);
	lv_obj_set_pos(ui->screen_tileview_1_view1, 0*240, 0);
	lv_obj_set_size(ui->screen_tileview_1_view1, 240, 232);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_tileview_1_view1);

	//Write codes screen_btn_a7
	ui->screen_btn_a7 = lv_btn_create(ui->screen_tileview_1_view1, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_a7
	static lv_style_t style_screen_btn_a7_main;
	lv_style_reset(&style_screen_btn_a7_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_a7_main
	lv_style_set_radius(&style_screen_btn_a7_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_a7_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_a7_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_a7_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_a7_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_a7_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_a7_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_a7_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_a7_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_a7_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_a7, LV_BTN_PART_MAIN, &style_screen_btn_a7_main);
	lv_obj_set_pos(ui->screen_btn_a7, 15, 153);
	lv_obj_set_size(ui->screen_btn_a7, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_a7);
	ui->screen_btn_a7_label = lv_label_create(ui->screen_btn_a7, NULL);
	lv_label_set_text(ui->screen_btn_a7_label, "钱包");
	lv_obj_set_style_local_text_color(ui->screen_btn_a7_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_a7_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_a4
	ui->screen_btn_a4 = lv_btn_create(ui->screen_tileview_1_view1, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_a4
	static lv_style_t style_screen_btn_a4_main;
	lv_style_reset(&style_screen_btn_a4_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_a4_main
	lv_style_set_radius(&style_screen_btn_a4_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_a4_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_a4_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_a4_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_a4_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_a4_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_a4_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_a4_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_a4_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_a4_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_a4, LV_BTN_PART_MAIN, &style_screen_btn_a4_main);
	lv_obj_set_pos(ui->screen_btn_a4, 15, 80);
	lv_obj_set_size(ui->screen_btn_a4, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_a4);
	ui->screen_btn_a4_label = lv_label_create(ui->screen_btn_a4, NULL);
	lv_label_set_text(ui->screen_btn_a4_label, "相册");
	lv_obj_set_style_local_text_color(ui->screen_btn_a4_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_a4_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_a3
	ui->screen_btn_a3 = lv_btn_create(ui->screen_tileview_1_view1, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_a3
	static lv_style_t style_screen_btn_a3_main;
	lv_style_reset(&style_screen_btn_a3_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_a3_main
	lv_style_set_radius(&style_screen_btn_a3_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_a3_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_a3_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_a3_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_a3_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_a3_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_a3_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_a3_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_a3_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_a3_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_a3, LV_BTN_PART_MAIN, &style_screen_btn_a3_main);
	lv_obj_set_pos(ui->screen_btn_a3, 165, 7);
	lv_obj_set_size(ui->screen_btn_a3, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_a3);
	ui->screen_btn_a3_label = lv_label_create(ui->screen_btn_a3, NULL);
	lv_label_set_text(ui->screen_btn_a3_label, "时钟");
	lv_obj_set_style_local_text_color(ui->screen_btn_a3_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_a3_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_a2
	ui->screen_btn_a2 = lv_btn_create(ui->screen_tileview_1_view1, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_a2
	static lv_style_t style_screen_btn_a2_main;
	lv_style_reset(&style_screen_btn_a2_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_a2_main
	lv_style_set_radius(&style_screen_btn_a2_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_a2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_a2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_a2_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_a2_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_a2_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_a2_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_a2_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_a2_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_a2_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_a2, LV_BTN_PART_MAIN, &style_screen_btn_a2_main);
	lv_obj_set_pos(ui->screen_btn_a2, 90, 7);
	lv_obj_set_size(ui->screen_btn_a2, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_a2);
	ui->screen_btn_a2_label = lv_label_create(ui->screen_btn_a2, NULL);
	lv_label_set_text(ui->screen_btn_a2_label, "日历");
	lv_obj_set_style_local_text_color(ui->screen_btn_a2_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_a2_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_a1
	ui->screen_btn_a1 = lv_btn_create(ui->screen_tileview_1_view1, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_a1
	static lv_style_t style_screen_btn_a1_main;
	lv_style_reset(&style_screen_btn_a1_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_a1_main
	lv_style_set_radius(&style_screen_btn_a1_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_a1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_a1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_a1_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_a1_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_a1_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_a1_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_a1_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_a1_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_a1_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_a1, LV_BTN_PART_MAIN, &style_screen_btn_a1_main);
	lv_obj_set_pos(ui->screen_btn_a1, 15, 7);
	lv_obj_set_size(ui->screen_btn_a1, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_a1);
	ui->screen_btn_a1_label = lv_label_create(ui->screen_btn_a1, NULL);
	lv_label_set_text(ui->screen_btn_a1_label, "本机");
	lv_obj_set_style_local_text_color(ui->screen_btn_a1_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_a1_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_tileview_1_view2
	ui->screen_tileview_1_view2 = lv_obj_create(ui->screen_tileview_1, NULL);
	lv_obj_set_style_local_bg_opa(ui->screen_tileview_1_view2, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 0);
	lv_obj_set_style_local_border_width(ui->screen_tileview_1_view2, LV_OBJ_PART_MAIN, LV_STATE_FOCUSED, 0);
	lv_obj_set_pos(ui->screen_tileview_1_view2, 1*240, 0);
	lv_obj_set_size(ui->screen_tileview_1_view2, 240, 232);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_tileview_1_view2);

	//Write codes screen_btn_b1
	ui->screen_btn_b1 = lv_btn_create(ui->screen_tileview_1_view2, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_b1
	static lv_style_t style_screen_btn_b1_main;
	lv_style_reset(&style_screen_btn_b1_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_b1_main
	lv_style_set_radius(&style_screen_btn_b1_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_b1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_b1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_b1_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_b1_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_b1_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_b1_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_b1_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_b1_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_b1_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_b1, LV_BTN_PART_MAIN, &style_screen_btn_b1_main);
	lv_obj_set_pos(ui->screen_btn_b1, 15, 7);
	lv_obj_set_size(ui->screen_btn_b1, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_b1);
	ui->screen_btn_b1_label = lv_label_create(ui->screen_btn_b1, NULL);
	lv_label_set_text(ui->screen_btn_b1_label, "呼吸灯");
	lv_obj_set_style_local_text_color(ui->screen_btn_b1_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_b1_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_b2
	ui->screen_btn_b2 = lv_btn_create(ui->screen_tileview_1_view2, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_b2
	static lv_style_t style_screen_btn_b2_main;
	lv_style_reset(&style_screen_btn_b2_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_b2_main
	lv_style_set_radius(&style_screen_btn_b2_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_b2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_b2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_b2_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_b2_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_b2_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_b2_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_b2_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_b2_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_b2_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_b2, LV_BTN_PART_MAIN, &style_screen_btn_b2_main);
	lv_obj_set_pos(ui->screen_btn_b2, 90, 7);
	lv_obj_set_size(ui->screen_btn_b2, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_b2);
	ui->screen_btn_b2_label = lv_label_create(ui->screen_btn_b2, NULL);
	lv_label_set_text(ui->screen_btn_b2_label, "电压表");
	lv_obj_set_style_local_text_color(ui->screen_btn_b2_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_b2_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_b3
	ui->screen_btn_b3 = lv_btn_create(ui->screen_tileview_1_view2, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_b3
	static lv_style_t style_screen_btn_b3_main;
	lv_style_reset(&style_screen_btn_b3_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_b3_main
	lv_style_set_radius(&style_screen_btn_b3_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_b3_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_b3_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_b3_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_b3_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_b3_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_b3_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_b3_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_b3_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_b3_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_b3, LV_BTN_PART_MAIN, &style_screen_btn_b3_main);
	lv_obj_set_pos(ui->screen_btn_b3, 165, 7);
	lv_obj_set_size(ui->screen_btn_b3, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_b3);
	ui->screen_btn_b3_label = lv_label_create(ui->screen_btn_b3, NULL);
	lv_label_set_text(ui->screen_btn_b3_label, "陀螺仪");
	lv_obj_set_style_local_text_color(ui->screen_btn_b3_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_b3_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_btn_b4
	ui->screen_btn_b4 = lv_btn_create(ui->screen_tileview_1_view2, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_b4
	static lv_style_t style_screen_btn_b4_main;
	lv_style_reset(&style_screen_btn_b4_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_b4_main
	lv_style_set_radius(&style_screen_btn_b4_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_b4_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_b4_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_b4_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_b4_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_b4_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_b4_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_b4_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_b4_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_b4_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_b4, LV_BTN_PART_MAIN, &style_screen_btn_b4_main);
	lv_obj_set_pos(ui->screen_btn_b4, 15, 80);
	lv_obj_set_size(ui->screen_btn_b4, 60, 60);
	lv_tileview_add_element(ui->screen_tileview_1, ui->screen_btn_b4);
	ui->screen_btn_b4_label = lv_label_create(ui->screen_btn_b4, NULL);
	lv_label_set_text(ui->screen_btn_b4_label, "温度计");
	lv_obj_set_style_local_text_color(ui->screen_btn_b4_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_b4_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);

	//Write codes screen_cont_2
	ui->screen_cont_2 = lv_cont_create(ui->screen, NULL);

	//Write style LV_CONT_PART_MAIN for screen_cont_2
	static lv_style_t style_screen_cont_2_main;
	lv_style_reset(&style_screen_cont_2_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_cont_2_main
	lv_style_set_radius(&style_screen_cont_2_main, LV_STATE_DEFAULT, 15);
	lv_style_set_bg_color(&style_screen_cont_2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_cont_2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_cont_2_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_cont_2_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_cont_2_main, LV_STATE_DEFAULT, lv_color_make(0x99, 0x99, 0x99));
	lv_style_set_border_width(&style_screen_cont_2_main, LV_STATE_DEFAULT, 1);
	lv_style_set_border_opa(&style_screen_cont_2_main, LV_STATE_DEFAULT, 255);
	lv_style_set_pad_left(&style_screen_cont_2_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_right(&style_screen_cont_2_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_top(&style_screen_cont_2_main, LV_STATE_DEFAULT, 0);
	lv_style_set_pad_bottom(&style_screen_cont_2_main, LV_STATE_DEFAULT, 0);
	lv_obj_add_style(ui->screen_cont_2, LV_CONT_PART_MAIN, &style_screen_cont_2_main);
	lv_obj_set_pos(ui->screen_cont_2, 5, 254);
	lv_obj_set_size(ui->screen_cont_2, 230, 64);
	lv_obj_set_click(ui->screen_cont_2, false);

	//Write codes screen_btn_7
	ui->screen_btn_7 = lv_btn_create(ui->screen_cont_2, NULL);

	//Write style LV_BTN_PART_MAIN for screen_btn_7
	static lv_style_t style_screen_btn_7_main;
	lv_style_reset(&style_screen_btn_7_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_btn_7_main
	lv_style_set_radius(&style_screen_btn_7_main, LV_STATE_DEFAULT, 20);
	lv_style_set_bg_color(&style_screen_btn_7_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_btn_7_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_btn_7_main, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_btn_7_main, LV_STATE_DEFAULT, 255);
	lv_style_set_border_color(&style_screen_btn_7_main, LV_STATE_DEFAULT, lv_color_make(0x01, 0xa2, 0xb1));
	lv_style_set_border_width(&style_screen_btn_7_main, LV_STATE_DEFAULT, 2);
	lv_style_set_border_opa(&style_screen_btn_7_main, LV_STATE_DEFAULT, 255);
	lv_style_set_outline_color(&style_screen_btn_7_main, LV_STATE_DEFAULT, lv_color_make(0xd4, 0xd7, 0xd9));
	lv_style_set_outline_opa(&style_screen_btn_7_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_btn_7, LV_BTN_PART_MAIN, &style_screen_btn_7_main);
	lv_obj_set_pos(ui->screen_btn_7, 85, 2);
	lv_obj_set_size(ui->screen_btn_7, 60, 60);
	ui->screen_btn_7_label = lv_label_create(ui->screen_btn_7, NULL);
	lv_label_set_text(ui->screen_btn_7_label, "阅读");
	lv_obj_set_style_local_text_color(ui->screen_btn_7_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_obj_set_style_local_text_font(ui->screen_btn_7_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_15);
	lv_cont_set_layout(ui->screen_cont_2, LV_LAYOUT_OFF);
	lv_cont_set_fit(ui->screen_cont_2, LV_FIT_NONE);

	//Init events for screen
	events_init_screen(ui);
}